from script.server.teleweb.HttpTelewebServer import HttpTelewebServer


class TclNbServer(HttpTelewebServer):
    NAME = 'TCL-NB'

    # _host: str = 'https://172.16.11.171'
    _host: str = 'https://172.16.11.200'
    _username: str = 'nbrootSh'
    _password: str = 'nb456Sh#'
    _PATTERN_FILE_LINE = r'<tr><td\s.+</td></tr>'
    _PATTERN_FILE_INFO = r'.*<img\s.*alt="\[(.+)\]".*>.*<a\s.*href="(.+)".*>.*</a></td><td align="right">([^<]+)</td>.*?>([^<]+)</td>.*'

    def __init__(self):
        super(TclNbServer, self).__init__(TclNbServer._host,
                                          TclNbServer._PATTERN_FILE_LINE, TclNbServer._PATTERN_FILE_INFO,
                                          TclNbServer._username, TclNbServer._password)

    def name(self) -> str:
        return TclNbServer.NAME
